<div class="page field-section" data-page="tallyDetail" id="tallyDetail">
	<div class="page-header">
		<label>当前位置：</label><a class="newTaskList">收货理货</a>&nbsp;&gt;&nbsp;<a class="taskDetail">理货详情</a>&nbsp;&gt;&nbsp;<a class="undoneCargoRecord">理货任务</a>&nbsp;&gt;&nbsp;理货任务详情
	</div>
	<div class="page-content" id="submitContainerTallying" action="submitContainerTallying" version="v1.0">
		<div class="page-content-main">
			<div class="page-content-main-header">
				<div class="page-content-main-header-item taskDetail"><b style="color: #FF7344;">理货任务信息</b></div>
				<span class="bar">|</span>
				<div class="page-content-main-header-item undoneCargoRecord" ><b>理货记录</b></div>
				<div class="page-content-main-header-item fr">
					<div class="page-content-button none tallyListGenerate">生成理货单</div>
					<div class="page-content-button none acceptTasks">接受任务</div>
				</div>
			</div>
			<div class="page-content-main-content tallyDetail_main_content" >
			</div>
		</div>
		
		<script type="text/template" id="financeWaybillListTpl">
			{@each datas as it}
			<option value="${it.waybillNumber}">${it.waybillNumber}</option>
			{@/each}
		</script>
		<script type="text/template" id="tallyDetailTpl">
			{@each datas[0].containerInventorys as it}
			<div class="line-gray"></div>
			<div class="page-content-main-content-item page-content-main-content-item11">
				<input type="hidden" name="tallyingId" value="${it.tallyingId}"/>
				<input type="hidden" name="inventoryHistoryId" value="${it.inventoryHistoryId}"/>
				<!--<img src="../../../res/images/icon/delete.png" class="delete"/>-->
				<div class="subitem">理货员：
					<input disabled="disabled" name="clerkName" type="text" placeholder="理货员" />
				</div>
				<div class="subitem">是否随车理货：
					<select disabled="disabled" style="width:170px" name="withCar">
                  		<option value="0">不是</option>
                  		<option value="1">是</option>
      				</select>
				</div>
				<div class="subitem">理货清单：
					<input disabled="disabled" type="text" name="tallyingFile" id="tallyingFile" placeholder="理货清单" readonly="readonly" class="noInput"/>
				</div>
				<div class="subitem">车牌号：
					<input disabled="disabled" type="text" placeholder="车牌号" name="plateNumber"  minLength="1" maxLength="255" />
				</div>
				<div class="subitem">司机：
					<input disabled="disabled" type="text" placeholder="司机" name="driver"  minLength="1" maxLength="255" />
				</div>
				<div class="subitem">司机联系方式：
					<input disabled="disabled" type="text" placeholder="司机联系方式" name="driverTel" minLength="1" maxLength="255" />
				</div>
				<div class="subitem"><span class="requiredInput">*</span>理货时限：
					<input readonly="readonly" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="field-input Wdate FromTime" isNull="1" codeName="理货时限" type="text" name="limitDate" placeholder="请输入时间" />
				</div>
				<div class="subitem">理货出发时间：
					<input disabled="disabled" class="field-input Wdate FromTime" isNull="0" codeName="理货时限" type="text" name="startDate" placeholder="请输入时间"/>
				</div>
				<div class="subitem">理货出发地点：
					<input disabled="disabled" type="text" placeholder="理货出发地点" name="driverAddress" minLength="1" maxLength="255" />
				</div>
				<div class="subitem">
					<span class="requiredInput">*</span>实际理货地址：<input type="text"  isNull="1" codeName="实际理货地址"  name="tallyAddress" value="${it.tallyAddress}"/>
				</div>
				<div class="subitem">
					<span class="requiredInput">*</span>所属物流公司：<select isNull="1" codeName="所属物流公司" name="logisticsCompanyInfoId"></select>
				</div>
				<!--<input type="hidden" name="logisticsCompanyInfoId" value="0" />-->
				<div class="clear"></div>
			</div>
			<div class="line-gray"></div>
			<div class="page-content-main-content-item">
				<div class="title">
					<b>装箱信息：</b>
				</div>
				<div class="subitem">
					<span class="requiredInput">*</span>箱号：<input onfocus="this.value=this.value.replace(' ','')" class="caseNumber toUp" type="text" class="toUp" name="caseNumber" value="${it.caseNumber}" isNull="1" codeName="箱号"/>
				</div>
				<div class="subitem"><span class="requiredInput">*</span>箱型尺寸：
					<select name="caseSize" value="${it.caseSize}">
						<option value="20GP">20GP</option>
						<option value="20HQ">20HQ</option>
						<option value="40GP">40GP</option>
						<option value="40HQ">40HQ</option>
						<option value="40RH">40RH</option>
					</select>
				</div>
				<div class="subitem"><span class="requiredInput">*</span>
					运单号：
					{@if datas[0].financeId == 0}
					<input type="text" name="waybillNumber" value="${it.waybillNumber}" isNull="1" codeName="物流运单号"/>
					{@else}
					<select class="waybillNumber"  isNull="1" codeName="物流运单号"  id="${it.waybillNumber}" name="waybillNumber"></select>
					{@/if}
				</div>
				<div class="subitem"><span class="requiredInput">*</span>
					铅封号1：<input type="text" class="toUp" isNull="1" codeName="铅封号1"  name="facingSlip" value="${it.facingSlip}"/>
				</div>
				<div class="subitem">铅封号2：<input type="text" class="toUp" name="facingSlipNext" value="${it.facingSlipNext}"/></div>
				<div class="clear"></div>
				<div class="line-gray"></div>
				<div class="title" style="margin-top: 15px;">
					<b>磅单：</b>
					<input name="file" type="file" id="poundsOfSign" class="none" multiple="multiple"/>
					<input type="hidden" name="poundsOfSign" id="poundsOfSignAdd" />
					<span class="fs"></span>
					<label for="poundsOfSign" class="productIntro">添加</label>
				</div>
				<div class="line-gray"></div>
				<div class="page-content-main-content-item">
					<div class="title"><b>货物清单：</b></div>
					<div class="content">
						{@each it.containerBulkstocks as that,index}
						<table class="table">
							<thead>
								<tr>
									<th>货物名称</th>
									<th>数量(${that.unit})--实际数量：<span class="quantity">${that.plannedQuantity}(${that.unit})</span></th>
									<th>重量(吨)--实际重量：${that.plannedWeight}(吨)</th>
									<th>体积(m<sup>3</sup>)--实际体积：${that.plannedVolume}(m<sup>3</sup>)</th>
									<th>托盘号</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>
										<input type="hidden" name="bulkstockHistoryId" value="${that.bulkstockHistoryId}"/>
										<input type="hidden" name="recieveNoticeDetailId" value="${that.recieveNoticeDetailId}"/>
										<input type="text" name="bulkstockName" class="noInput" readonly="readonly" value="${that.bulkstockName}"/><br /><span style="visibility: hidden;">1</span>
									</td>
									<td>
										<input type="text" class="arrayTally tallyQuantity" name="quantity" value="${that.quantity}" bulkstockId="${that.bulkstockId}" max="${that.plannedQuantity}" maxWeight="${that.plannedWeight}" maxVolume="${that.plannedVolume}"/>
										<br />
										差值：<span class="differenceValueQuantity"></span>
									</td>
									<td><input type="text" class="arrayTally tallyWeight" name="weight" value="${that.weight}"/>
										<br />
										差值：<span class="differenceValueWeight"></span>
									</td>
									<td><input type="text" class="arrayTally tallyVolume" name="volume" value="${that.volume}"/>
										<br />
										差值：<span class="differenceValueVolume"></span>
									</td>
									<td>
										<input type="text" class="arrayTally toUp" name="trayNumber" value="${that.trayNumber}"/><br /><span style="visibility: hidden;">1</span>
									</td>
								</tr>
								<tr>
									<td colspan="5">货物照片：
										<input isNull="1" codeName="货物照片" type="hidden" name="filesUuid" class="bulkstockFilesUuids" value="${that.filesUuid}"/>
										<div class="uploadImgP" id="uploadImgP${index}">
											<label for="uploadFile${index}" class="file"> 点击上传图片<input multiple="multiple" type="file" class="uploadFileInput" name="file" id="uploadFile${index}" accept=".png,.jpg,.bmp"/></label>
										</div>
										<div class="img-list"></div>
										<p style="margin-top: 15px;">${it.createDateTime}</p>
									</td>
								</tr>
								<tr>
									<td colspan="4">
										<span>货物异常标识：
											<select name="bulkstockAbnormal" value="${that.abnormal}" id="${that.abnormal}">
												<option value="1">正常</option>
												<option value="0">异常</option>
											</select>
										</span>
										<span>货物异常说明：
											<textarea class="arrayTally" name="bulkstockAbnormalComment">${that.abnormalComment}</textarea>
										</span>
									</td>
								</tr>
							</tbody>
						</table>
						{@/each}
					</div>
				</div>
			
				<div class="page-content-main-content-item">
				<div class="title"><span class="requiredInput">*</span><b>理货前照片：</b></div>
				<div class="content">
					<input type="hidden" isNull="1" codeName="理货前照片" name="tallyPreFile" value="${it.tallyPreFile}" class="preTallyFiles"/>
					<p id="uploadFilepreTallyP" class="uploadFilepreTallyP">
						<label for="uploadFilepreTally" class="file"> 点击上传图片<input multiple="multiple" type="file" class="uploadFileInput1" name="file" id="uploadFilepreTally" accept=".png,.jpg,.bmp"/></label>
					</p>				
				</div>
					<p style="margin-top: 15px;">${it.createDateTime}</p>
				</div>
				<div class="page-content-main-content-item">
					<div class="title"><span class="requiredInput">*</span><b>理货后照片：</b></div>
					<div class="content">
						<input type="hidden" isNull="1" codeName="理货后照片" name="tallySuffixFile" value="${it.tallySuffixFile}" class="suffixTallyFiles"/>
						<p id="uploadFilesuffixTallyP" class="uploadFilesuffixTallyP">
							<label for="uploadFilesuffixTally" class="file"> 点击上传图片<input multiple="multiple" type="file" class="uploadFileInput2" name="file" id="uploadFilesuffixTally" accept=".png,.jpg,.bmp"/></label>
						</p>				
					</div>
					<p style="margin-top: 15px;">${it.createDateTime}</p>
				</div>
				<div class="page-content-main-content-item">
					<div class="title"><b>理货异常：</b></div>
					<div class="content">
						<span>理货异常标注：
							<select name="abnormal" class="tallyAbnormal" value="${it.abnormal}" id="${it.abnormal}">
								<option value="1">正常</option>
								<option value="0">异常</option>
							</select>
						</span>
						<span>理货异常说明：
							<textarea name="tallyRemark">${it.tallyRemark}</textarea>
						</span>
					</div>
				</div>
				<div class="page-content-main-content-item none abnormalDiv1">
					<div class="title"><b>异常单：</b></div>
					<p>
						<span>
							<span class="requiredInput">*</span>异常理货地点：
							<input type="text"  maxlength="255" name="tallyExAddress" value="${it.tallyExAddress}" />
						</span>
						<span>
							<span class="requiredInput">*</span>异常理货类型：
							<select name="tallyExAbnormalState" value="${it.tallyExAbnormalState}">
								<option value="0">未知</option>
								<option value="1">货损</option>
								<option value="2">丢失</option>
							</select>
						</span>
					</p>
					<p>
						<span>
							<span class="requiredInput">*</span>理货异常说明：
							<textarea name="tallyExRemark" class="abnormalComment"  maxlength="255">${it.tallyExRemark}</textarea>
						</span>
					</p>
					<div style="min-height: 120px;">
						录音文件:
						<input type="hidden"  name="tallyExSoundRecorde" id="soundRecorde1" />
						<p id="soundRecordeP" class="soundRecordeP">
							<label for="uploadFileSoundRecorde1" class="file uploadFileSoundRecorde1"> 上传录音文件
								<input type="file" class="uploadFileInput2" name="file" id="uploadFileSoundRecorde1" />
							</label>
						</p>
						<a target="_blank" href="/finance/api/v1.0/downloadFile.file?fileUuid=${it.tallyExSoundRecorde}">${inquireFile(it.tallyExSoundRecorde)}</a>    
					</div>
					<div style="min-height: 120px;">
						异常图片:
						<input type="hidden" name="tallyExAbnormalFile" id="abnormalFile1" />
						<p id="abnormalFileP" class="abnormalFileP">
							<label for="uploadFileAbnormalFile1" class="file uploadFileAbnormalFile1"> 上传异常图片
								<input type="file" class="uploadFileInput2" name="file" id="uploadFileAbnormalFile1" accept=".png,.jpg,.bmp" />
							</label>
						</p>
						<a target="_blank" href="/finance/api/v1.0/downloadFile.file?fileUuid=${it.tallyExAbnormalFile}">
							<img style="width: 85px; height: 85px;" src="/finance/api/v1.0/downloadFile.file?fileUuid=${it.tallyExAbnormalFile}" />
						</a>
					</div>
				</div>
			</div>
			{@/each}
		</script>
				
		<!--自理-->
		<script type="text/template" id="tallyDetailTpl2">
			<div class="line-gray"></div>
			<div class="page-content-main-content-item">
				<input type="hidden" name="tallyingId" value=""/>
				<input type="hidden" name="inventoryHistoryId" value=""/>
				<span>实际理货地址：<input type="text"  isNull="1" codeName="实际理货地址"  name="tallyAddress" /></span>
			</div>
			<div class="line-gray"></div>
			<div class="page-content-main-content-item">
				<div class="title"><b>装箱信息：</b></div>
				<div class="content">
					<span class="requiredInput">*</span>箱号：<input type="text" name="caseNumber"  isNull="1" codeName="箱号"/>
					<span><span class="requiredInput">*</span>箱型尺寸：
						<select name="caseSize" >
							<option value="20GP">20GP</option>
							<option value="20HQ">20HQ</option>
							<option value="40GP">40GP</option>
							<option value="40HQ">40HQ</option>
							<option value="40RH">40RH</option>
						</select>
					</span>
					<span>
						<span class="requiredInput">*</span>
						运单号：<select class="waybillNumber"  isNull="1" codeName="物流运单号"  name="waybillNumber"></select>
					</span>
					<span><span class="requiredInput">*</span>铅封号1：<input type="text" class="toUp" isNull="1" codeName="铅封号1"  name="facingSlip" /></span>
					<span>铅封号2：<input type="text" class="toUp" name="facingSlipNext" /></span>
				</div>
			</div>
			
			<div class="line-gray"></div>
			<div class="page-content-main-content-item">
				<div class="title"><b>货物清单：</b><label class="addCommodity"></label></div>
				<div class="content" id="commodityContent">
				</div>
			</div>
			<div class="page-content-main-content-item">
				<div class="title"><b>理货前照片：</b></div>
				<div class="content">
					<input type="hidden" isNull="1" codeName="理货前照片" name="tallyPreFile"  class="preTallyFiles"  isNull="1" codeName="理货前照片"/>
					<p id="uploadFilepreTallyP" class="uploadFilepreTallyP">
						<label for="uploadFilepreTally" class="file"> 点击上传图片<input type="file" class="uploadFileInput1" name="file" id="uploadFilepreTally" accept=".png,.jpg,.bmp"/></label>
					</p>				
				</div>
			</div>
			<div class="page-content-main-content-item">
				<div class="title"><b>理货后照片：</b></div>
				<div class="content">
					<input type="hidden" isNull="1" codeName="理货后照片" name="tallySuffixFile"  class="suffixTallyFiles"  isNull="1" codeName="理货后照片"/>
					<p id="uploadFilesuffixTallyP" class="uploadFilesuffixTallyP">
						<label for="uploadFilesuffixTally" class="file"> 点击上传图片<input type="file" class="uploadFileInput2" name="file" id="uploadFilesuffixTally" accept=".png,.jpg,.bmp"/></label>
					</p>				
				</div>
			</div>
			<div class="page-content-main-content-item">
				<div class="title"><b>理货异常：</b></div>
				<div class="content">
					<span>理货异常标注：
						<select name="abnormal" class="tallyAbnormal">
							<option value="1">正常</option>
							<option value="0">异常</option>
						</select>
					</span>
					
					<span>理货异常说明：
						<textarea name="tallyRemark"></textarea>
					</span>
				</div>
			</div>
		</script>
				
		<div class="page-content-main-content-item none abnormalDiv">
			<div class="title"><b>异常单：</b></div>
			<p>
				<span><span class="requiredInput">*</span>异常理货地点：
				<input type="text"  maxlength="255" name="tallyExAddress" />
				</span>
				<span><span class="requiredInput">*</span>异常理货类型：
				<select name="tallyExAbnormalState">
					<option value="0">未知</option>
					<option value="1">货损</option>
					<option value="2">丢失</option>
				</select>
				</span>
			</p>
			<p>
				<span>
					<span class="requiredInput">*</span>理货异常说明：
					<textarea name="tallyExRemark" class="abnormalComment"  maxlength="255"></textarea>
				</span>
			</p>
	
			<div style="min-height: 120px;">
				录音文件:
				<input type="hidden"  name="tallyExSoundRecorde" id="soundRecorde1" />
				<p id="soundRecordeP" class="soundRecordeP">
					<label for="uploadFileSoundRecorde1" class="file uploadFileSoundRecorde1"> 上传录音文件
						<input type="file" class="uploadFileInput2" name="file" id="uploadFileSoundRecorde1" />
					</label>
				</p>
			</div>
			<div style="min-height: 120px;">
				异常图片:
				<input type="hidden" name="tallyExAbnormalFile" id="abnormalFile1" />
				<p id="abnormalFileP" class="abnormalFileP">
					<label for="uploadFileAbnormalFile1" class="file uploadFileAbnormalFile1"> 上传异常图片
						<input type="file" class="uploadFileInput2" name="file" id="uploadFileAbnormalFile1" accept=".png,.jpg,.bmp" />
					</label>
				</p>
			</div>
		</div>
		<div class="">
			<div id="submitTally" class="submitTally dialogBtn dialogHandlerBtn">提交理货</div>
		</div>
	</div>
	<!--<input id="logoimg" class="addlogo" type="file" multiple
			accept="image/*" name="imgFile" onchange="readFiles(event)">
	<div id="imgs"></div>
	<input type="button" value="提交" onclick="upload()">
	
	<script type="text/javascript">
		function readFiles(evt) {
			var files = evt.target.files;
			//console.log(files.length);
			if (!files) {
				alert("文件不支持");
				return;
			}
			
			for ( var i = 0; i < files.length; i++) {
				var imgele = new Image();
				var thesrc = window.URL.createObjectURL(files[i]);
				imgele.src = thesrc;
				imgele.name = files[i].name;
				imgele.onload = function() {
					//$("#showlogo").attr("src",this.src); 
// 					var c = document.getElementById("myCanvas");
// 					c.style.display = "block";
// 					var cxt = c.getContext("2d");
// 					cxt.drawImage(this, 0, 0, 200, 200);
					var canvas = document.createElement("canvas");
					canvas.setAttribute("id", "myCanvas");
					canvas.setAttribute("width", "1200px");
					canvas.setAttribute("height", "1200px");
					canvas.setAttribute("onclick", "del(this)");
					canvas.setAttribute("name", this.name);
					canvas.innerHTML = "你的浏览器不支持";
					var imgs = document.getElementById("imgs");
					imgs.appendChild(canvas);
					var cxt = canvas.getContext("2d");
					cxt.drawImage(this, 0, 0, 200, 200);
				}
			}
		}
		
		function del(view) {
			$(view).remove();
		}

		function upload() {
			$.each($("canvas"), function(i){
				//alert(i);
				var canvas = this;
				alert($(canvas).attr("fileName"));
				//将图像输出为base64压缩的字符串  默认为image/png
				var data = canvas.toDataURL("image/jpeg");
				//alert(data);
				//删除字符串前的提示信息 "data:image/png;base64,"  
				//var b64 = data.substring(23);
				var b64 = data.split(",")[1];
				//POST到服务器上，生成图片                      
				//alert(b64);
	 			$.post("/finance/api/v1.0/newUploadFile.json", {
	 				imgData : b64,
	 				imgName : $(canvas).attr("fileName") + ".jpeg"
	 				}, function(response) {
	 			});
			});
		}
	</script>-->
</div>